#ifndef _UI_POLYLINE_H_
#define _UI_POLYLINE_H_

#include "ui_widget.h"
#include "ui_trsprite.h"

namespace ui
{
class UIPolyLine : public UIWidget
{
public:
/// stuff that every self-respecting widget should have
						UIPolyLine(UIWidget* pParent,const std::string& Name = "");
	virtual				~UIPolyLine();
	virtual bool		Create(const std::string& Name, const math::Vec2& Pos = math::Vec2(0.5f, 0.5f), const math::Vec2& Size= math::Vec2(0.1f, 0.1f));
	virtual	bool		Load(LuaPlus::LuaObject& _LObj);
	/// update
	virtual	bool		Tick(float dt);
	/// display
	virtual bool		Render(bool Force = false);
	/// register with LUA Bind
	static	void		Register(LuaPlus::LuaState* _pScript);

	//POLYLINE-SPECIFIC STUFF

	//METHODS
	void				AddNewPoint(const math::Vec2& NewPoint) {m_LinePoints.push_back(NewPoint);};
	void				ClearPoints() {m_LinePoints.clear();};

	//MEMBERS
	void				SetSegmentColor(const math::Vec4& c) { m_SegmentColor = c; }


protected:

	//METHODS

	//MEMBERS


	//widget params

	math::Vec2			  m_LineWidth;

	std::list<math::Vec2> m_LinePoints;



	//line segment sprite
	TrSprite			  m_SpriteSegment;

	math::Vec4			  m_SegmentColor; 
	bool				  m_SegmentAdditive;

	float				  m_CurAnimFactor;


};//class UIPolyLine : public UIWidget
};//namespace ui


#endif